<?php echo $this->partial('_displayPoll.tpl', 'poll', array('item' => $this->question, 'options' => $this->options, 'show_all' => true));?>
<?php $totalFollowers = count($this->question->getFollowers());?>
<div class="clear"></div>
<div class="uiSideHeader">
    <div class="headTitle"><?php echo $this->translate('Ask By');?></div> 
    <div class="iRight"><?php echo $this->translate(array('%s Vote', '%s Votes', $this->question->total_votes), $this->locale()->toNumber($this->question->total_votes));?> · <?php echo $this->translate(array("%s Follower", "%s Followers", $totalFollowers), $this->locale()->toNumber($totalFollowers));?></div>
</div>
<div class="owner_information">
    <?php $owner = $this->question->getOwner(); ?>
    <div class="owner_photo"><?php echo $this->htmlLink($owner->getHref(), $this->uPhoto($owner, 'thumb.icon'), array('class' => 'item_big'));?></div>
    <div class="owner_brief">
        <span class="owner_title"><?php echo $this->htmlLink($owner->getHref(), $owner->getTitle());?></span>
        <div class="poll_action">
        <?php echo $this->timestamp($this->question->creation_date);?>
        <?php 
        $viewer = Engine_Api::_()->user()->getViewer();
        ?>
        <?php if ($viewer->getIdentity() == $this->question->user_id): ?>
        <?php $token = base64_encode($this->question->getIdentity());?>
         · <a href="javascript:void(0);" onclick="Poll.edit('<?php echo $token;?>')"><?php echo $this->translate('Edit Options');?></a>
        <?php endif; ?>
        </div>
    </div>
    <?php if ($viewer->getIdentity()):?>
    <div class="user_action">
        <?php $isFollowed = $this->question->isFollowed($viewer) ? 1 : 0; $isSelf = $this->question->user_id == $viewer->getIdentity() ? 1 : 0;?>
        <a href="javascript:void(0);" onclick="Poll.askFriends(<?php echo $this->question->getIdentity();?>)" class="fb_add fb_btn"><i class="icon_ask_friend fb_icons1"></i><?php echo $this->translate('Ask Friends');?></a>
        <?php if (!$isSelf):?>
        <a href="javascript:void(0);" onclick="Poll.follow($(this), <?php echo $this->question->getIdentity();?>)" class="fb_add fb_btn"><i class="icon_follow fb_icons2"></i><span class="content"><?php echo $this->translate($isFollowed ? 'Unfollow' : 'Follow');?></span></a>
        <?php endif; ?>
    </div>
    <?php endif; ?>
</div>
<div class="question_comments" id="question_comments">
<div class="uiSideHeader">
    <div class="headTitle"><?php echo $this->translate('Comments');?></div>     
</div>
<?php if (!$this->isAjax):?>
<?php echo $this->action('list', 'comment', 'core', array('type' => $this->question->getType(), 'id' => $this->question->getIdentity()));?>
<?php endif;?>
</div>